<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="gorevler" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{gorevlerHome.managed ? 'Edit' : 'Add'} Gorevler</f:facet>


            <s:decorate id="idField" template="layout/edit.xhtml">
                <ui:define name="label">Id</ui:define>
                <h:inputText id="id"
                       required="true"
                          value="#{gorevlerHome.instance.id}"
                           size="26">
                    <a:support event="onblur" reRender="idField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>



            <s:decorate id="gorevAdiField" template="layout/edit.xhtml">
                <ui:define name="label">Gorev adi</ui:define>
                <h:inputText id="gorevAdi"
                       required="true"
                           size="50"
                      maxlength="50"
                          value="#{gorevlerHome.instance.gorevAdi}">
                    <a:support event="onblur" reRender="gorevAdiField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>

            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{gorevlerHome.persist}"
                       disabled="#{!gorevlerHome.wired}"
                       rendered="#{!gorevlerHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{gorevlerHome.update}"
                       rendered="#{gorevlerHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{gorevlerHome.remove}"
                      immediate="true"
                       rendered="#{gorevlerHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/Gorevler.xhtml"
                rendered="#{gorevlerHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty gorevlerFrom ? 'GorevlerList' : gorevlerFrom}.xhtml"
                rendered="#{!gorevlerHome.managed}"/>

        </div>
    </h:form>

</ui:define>

</ui:composition>
